package edu.sctu.zhoumengxue.day201505.day20150522.student;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created by user12 on 2015/5/22.
 */
public class Text {
    public static void main(String[] args) {
        ArrayList list = new ArrayList();
        list.add(0, "aa");
        list.add(1, "bb");
        list.add(2, "cc");
        list.add(3, "dd");
        for (int i = 0; i < 10; i++) {
            list.add(Integer.toString(i));

        }
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));

        }
        for (Iterator i = list.iterator(); i.hasNext(); ) {
            //首先定义一个list对象的Iterator,然后利用该Iterator进行循环迭代操作
            String string = (String) i.next();
            System.out.println(string);
        }
    }
}
